<template>
  <div>

    <el-card>

      <el-row :gutter="10" class="mb8">
        <el-col :span="1.5">
          <el-button
            type="primary"
            icon="el-icon-plus"
            size="mini"
            @click="handleAdd"
            v-hasPermi="['shopping:supplier:addsi']"
          >新增</el-button>
        </el-col>
        <el-col :span="1.5">
          <el-button
            type="success"
            icon="el-icon-edit"
            size="mini"
            :disabled="single"
            @click="handleUpdate"
            v-hasPermi="['shopping:supplier:editsi']"
          >修改</el-button>
        </el-col>
        <el-col :span="1.5">
          <el-button
            type="danger"
            icon="el-icon-delete"
            size="mini"
            :disabled="multiple"
            @click="handleDelete"
            v-hasPermi="['shopping:supplier:removesi']"
          >删除</el-button>
        </el-col>

        <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
      </el-row>



      <div>
        <el-table v-loading="loading" @row-dblclick="dbClick" :data="infoList" @selection-change="handleSelectionChange">
          <el-table-column type="selection" width="55" align="center" />
          <el-table-column label="店铺名称" align="center">
            <template slot-scope="scope">
              <router-link :to="'/goods/type/dataSp/' + scope.row.supplierId" class="link-type">
                <span>{{ scope.row.shopsName }}</span>
              </router-link>
            </template>
          </el-table-column>
          <el-table-column label="供应商编码" align="center" prop="supplierCode" />
          <el-table-column label="供应商名称" align="center" prop="supplierName" />
<!--          <el-table-column label="供应商类型" align="center" >-->
<!--            <template slot-scope="scope">-->
<!--              {{scope.row.supplierType=='1' ? '自营签约门店' : '平台签约门店'}}-->
<!--            </template>-->
<!--          </el-table-column>-->
          <el-table-column label="店铺类型" align="center" prop="supplierTypeform" >
            <template slot-scope="scope">
              {{scope.row.supplierTypeform=='1' ? '物品' : '技术'}}
            </template>
          </el-table-column>
          <el-table-column label="供应商联系人" align="center" prop="linkMan" />
          <el-table-column label="联系电话" align="center" prop="phoneNumber" />
<!--          <el-table-column label="供应商开户银行名称" align="center" prop="bankName" />-->
<!--          <el-table-column label="银行账号" align="center" prop="bankAccount" />-->
          <el-table-column label="供应商地址" align="center" prop="address" />
          <el-table-column label="平台优惠卷" align="center" prop="platformId" />
          <el-table-column label="状态" align="center" >
            <template slot-scope="scope">
              <el-switch
                v-model="scope.row.supplierStatus"
                active-value="0"
                inactive-value="1"
                @change="handleStatusChange(scope.row)"
              ></el-switch>
            </template>
          </el-table-column>

          <el-table-column label="最后修改时间" align="center" prop="modifiedTime" width="180">
            <template slot-scope="scope">
              <span>{{ parseTime(scope.row.modifiedTime, '{y}-{m}-{d}') }}</span>
            </template>
          </el-table-column>

          <el-table-column label="用户账号" align="center" prop="userName" />
          <el-table-column label="操作" align="center" width="300px" class-name="small-padding fixed-width">
            <template slot-scope="scope">

              <el-button
                size="mini"
                type="text"
                icon="el-icon-edit"
                @click="handleStateFX(scope.row)"
                v-hasPermi="['distribution:team:add']"
              >分销</el-button>

              <el-button
                size="mini"
                type="text"
                icon="el-icon-edit"
                @click="handleStatePT(scope.row)"
                v-hasPermi="['shopping:supplier:editsi']"
              >平台优惠卷</el-button>

              <el-button
                size="mini"
                type="text"
                icon="el-icon-edit"
                @click="handlePreferent(scope.row)"
                v-hasPermi="['preferen:card:add']"
              >增加优惠卷</el-button>

              <el-button
                size="mini"
                type="text"
                icon="el-icon-edit"
                @click="handleUpdate(scope.row)"
                v-hasPermi="['shopping:supplier:editsi']"
              >修改</el-button>
              <el-button
                size="mini"
                type="text"
                icon="el-icon-delete"
                @click="handleDelete(scope.row)"
                v-hasPermi="['shopping:supplier:removesi']"
              >删除</el-button>

<!--              <el-button-->
<!--                size="mini"-->
<!--                type="text"-->
<!--                icon="el-icon-delete"-->
<!--                @click="handleDeletebaozheng(scope.row)"-->
<!--              >添加保证金</el-button>-->
            </template>
          </el-table-column>
        </el-table>


        <pagination
          v-show="total>0"
          :total="total"
          :page.sync="queryParams.pageNum"
          :limit.sync="queryParams.pageSize"
          @pagination="getList"
        />

      </div>
      <el-dialog :title="titlebzj" :visible.sync="openbzj"  width="500px" append-to-body >
        <el-form ref="form" :model="formbzj" label-width="80px">
          <el-form-item label="保证金余额" prop="balanceMoney">
            <el-input v-model="formbzj.balanceMoney" placeholder="请输入保证金余额" />
          </el-form-item>
        </el-form>
        <div slot="footer" class="dialog-footer">
          <el-button type="primary" @click="submitFormbzj">确 定</el-button>
          <el-button @click="cancelbzj">取 消</el-button>
        </div>
      </el-dialog>


      <!--  平台优惠卷增加 -->
      <el-dialog :title="titlePT" :visible.sync="openPT"  width="500px" append-to-body >
        <el-form ref="formPT" :model="formPT" label-width="100px">
          <el-form-item label="平台优惠卷" prop="platformId">
            <!--<el-input v-model="formPT.platformId" placeholder="请输入店铺名称" />-->
            <el-select v-model="formPT.platformId" placeholder="请选择优惠卷">
              <el-option v-for="item in AddCommonOne" :key="item.platformId" :label="item.platformName"  :value="item.platformId"></el-option>
            </el-select>
          </el-form-item>
        </el-form>
        <div slot="footer" class="dialog-footer">
          <el-button type="primary" @click="submitFormPT">确  定</el-button>
          <el-button @click="cancelPT">取消</el-button>
        </div>
      </el-dialog>

      <el-dialog :title="title" :visible.sync="open"  width="500px" append-to-body >
        <el-form ref="form" :model="form" label-width="100px">


          <el-form-item label="店铺名称" prop="shopsName">
            <el-input v-model="form.shopsName" placeholder="请输入店铺名称" />
          </el-form-item>

          <el-form-item label="供应商名称" prop="supplierName">
            <el-input v-model="form.supplierName" placeholder="请输入供应商名称" />
          </el-form-item>


          <el-form-item label="供应商联系人" prop="linkMan">
            <el-input v-model="form.linkMan" placeholder="请输入供应商联系人" />
          </el-form-item>
          <el-form-item label="联系电话" prop="phoneNumber">
            <el-input v-model="form.phoneNumber" placeholder="请输入联系电话" />
          </el-form-item>
          <el-form-item label="供应商开户银行名称" prop="bankName">
            <el-input v-model="form.bankName" placeholder="请输入供应商开户银行名称" />
          </el-form-item>
          <el-form-item label="银行账号" prop="bankAccount">
            <el-input v-model="form.bankAccount" placeholder="请输入银行账号" />
          </el-form-item>
          <el-form-item label="供应商地址" prop="address">
            <el-input v-model="form.address" placeholder="请输入供应商地址" />
          </el-form-item>

        </el-form>

        <div slot="footer" class="dialog-footer">
          <el-button type="primary" @click="submitForm">确  定</el-button>
          <el-button @click="cancel">取消</el-button>
        </div>

      </el-dialog>


    </el-card>

    <div :style="uuu">

      <el-card>

        <el-table v-loading="loading" :data="cardList" @selection-change="handleSelectionChange">
          <el-table-column type="selection" width="55" align="center" />
          <!--<el-table-column label="优惠卷ID" align="center" prop="preferentialId" />-->
          <!--<el-table-column label="店铺ID" align="center" prop="supplierId" />-->
          <!--<el-table-column label="商品ID" align="center" prop="productId" />-->
          <el-table-column label="优惠卷名称" align="center" prop="preferentialName" />
          <el-table-column label="优惠卷价格" align="center" prop="preferentialPrice" />
          <el-table-column label="满减使用价格" align="center" prop="preferentialPriceMost" />

          <!--<el-table-column label="类型" align="center" prop="preferentialType" />-->
          <el-table-column label="状态" align="center" prop="preferentialState" >
            <template slot-scope="scope">
              <el-tag
                :type="scope.row.preferentialState === '0' ? 'success' : 'danger'"
                disable-transitions>{{scope.row.preferentialState ==='0' ? '启动' : '禁用'}}</el-tag>
            </template>
          </el-table-column>
          <!--<el-table-column label="备用" align="center" prop="preferentialRemark" />-->
          <el-table-column label="起止时间" align="center" prop="modifiedTime" width="180">
            <template slot-scope="scope">
              <span>{{ parseTime(scope.row.modifiedTime, '{y}-{m}-{d}') }}</span>
            </template>
          </el-table-column>
          <el-table-column label="终止时间" align="center" prop="preferentialTime" width="180">
            <template slot-scope="scope">
              <span>{{ parseTime(scope.row.preferentialTime, '{y}-{m}-{d}') }}</span>
            </template>
          </el-table-column>
          <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
            <template slot-scope="scope">
              <el-button
                size="mini"
                type="text"
                icon="el-icon-edit"
                @click="handleUpdatePr(scope.row)"
                v-hasPermi="['preferen:card:edit']"
              >修改</el-button>
              <el-button
                size="mini"
                type="text"
                icon="el-icon-delete"
                @click="handleDeletePr(scope.row)"
                v-hasPermi="['preferen:card:remove']"
              >删除</el-button>
            </template>
          </el-table-column>
        </el-table>


        <el-dialog :title="titleFX" :visible.sync="openFX" width="100%" show-close="true" append-to-body>

          <el-table v-loading="loading" :data="teamList" @selection-change="handleSelectionChange">
            <el-table-column type="selection" width="55" align="center" />
            <el-table-column label="商家分销ID" align="center" prop="distributionId" />
            <el-table-column label="店铺ID" align="center" prop="supplierId" />
            <el-table-column label="超管分销佣金表ID" align="center" prop="commissionId" />
            <el-table-column label="商家分销编号" align="center" prop="distributionCode" />
            <el-table-column label="AppID" align="center" prop="appId" />
            <el-table-column label="AppSecent" align="center" prop="appSecent" />
            <!--<el-table-column label="商品URL,暂用" align="center" prop="distributionUrl" />-->
            <el-table-column label="启用/禁用" align="center" prop="distributionState" >
              <template slot-scope="scope">
                <el-tag
                  :type="scope.row.distributionState === '0' ? 'success' : 'danger'"
                  disable-transitions>{{scope.row.distributionState ==='0' ? '启动' : '禁用'}}</el-tag>
              </template>
            </el-table-column>
            <el-table-column label="最后修改时间" align="center" prop="modifiedTime" width="180">
              <template slot-scope="scope">
                <span>{{ parseTime(scope.row.modifiedTime, '{y}-{m}-{d}') }}</span>
              </template>
            </el-table-column>
            <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
              <template slot-scope="scope">
                <el-button
                  size="mini"
                  type="text"
                  icon="el-icon-edit"
                  @click="handleUpdateFX(scope.row)"
                  v-hasPermi="['distribution:team:edit']"
                >修改</el-button>
                <!--<el-button-->
                  <!--size="mini"-->
                  <!--type="text"-->
                  <!--icon="el-icon-delete"-->
                  <!--@click="handleDelete(scope.row)"-->
                  <!--v-hasPermi="['system:team:remove']"-->
                <!--&gt;删除</el-button>-->
              </template>
            </el-table-column>
          </el-table>



          <!-- 添加或修改商家分销对话框 -->
          <el-dialog :title="titleFXER" :visible.sync="openFXER" width="500px" append-to-body>
            <el-form ref="formFXER" :model="formFXER" :rules="rules" label-width="80px">
              <!--<el-form-item label="店铺ID" prop="supplierId">-->
                <!--<el-input v-model="formFXER.supplierId" placeholder="请输入店铺ID" />-->
              <!--</el-form-item>-->
              <el-form-item label="超管分销佣金表ID" prop="commissionId">
                <el-input v-model="formFXER.commissionId" placeholder="请输入超管分销佣金表ID" />
              </el-form-item>
              <!--<el-form-item label="商家分销编号" prop="distributionCode">-->
                <!--<el-input v-model="formFXER.distributionCode" placeholder="请输入商家分销编号" />-->
              <!--</el-form-item>-->
              <el-form-item label="AppID" prop="appId">
                <el-input v-model="formFXER.appId" placeholder="请输入AppID" />
              </el-form-item>
              <el-form-item label="AppSecent" prop="appSecent">
                <el-input v-model="formFXER.appSecent" placeholder="请输入AppSecent" />
              </el-form-item>
              <!--<el-form-item label="商品URL,暂用" prop="distributionUrl">-->
                <!--<el-input v-model="formFXER.distributionUrl" placeholder="请输入商品URL,暂用" />-->
              <!--</el-form-item>-->
              <el-form-item label="启用/禁用" prop="distributionState">
                <el-select v-model="form.distributionState" @change="getList" id="distributionState">
                  <el-option value="0" label="启用"></el-option>
                  <el-option value="1" label="禁用"></el-option>
                </el-select>
                <!--<el-input v-model="formFXER.distributionState" placeholder="请输入0启用  1禁用" />-->
              </el-form-item>
              <!--<el-form-item label="最后修改时间" prop="modifiedTime">-->
                <!--<el-date-picker clearable size="small" style="width: 200px"-->
                                <!--v-model="formFXER.modifiedTime"-->
                                <!--type="date"-->
                                <!--value-format="yyyy-MM-dd"-->
                                <!--placeholder="选择最后修改时间">-->
                <!--</el-date-picker>-->
              <!--</el-form-item>-->
            </el-form>
            <div slot="footer" class="dialog-footer">
              <el-button type="primary" @click="submitFormFXER">确 定</el-button>
              <el-button @click="cancelFXER">取 消</el-button>
            </div>
          </el-dialog>

        </el-dialog>

        <!-- 添加或修改优惠卷对话框 -->
        <el-dialog :title="titlePr" :visible.sync="openPr" width="500px" append-to-body>
          <el-form ref="formPr" :model="formPr" label-width="150px">

            <el-form-item label="优惠卷名称" prop="preferentialName">
              <el-input v-model="formPr.preferentialName" placeholder="请输入优惠卷名称" />
            </el-form-item>
            <el-form-item label="优惠卷价格" prop="preferentialPrice">
              <el-input v-model="formPr.preferentialPrice" placeholder="请输入优惠卷价格" />
            </el-form-item>
            <el-form-item label="满减使用价格" prop="preferentialPriceMost">
              <el-input v-model="formPr.preferentialPriceMost" placeholder="请输入满减使用价格" />
            </el-form-item>

            <el-form-item label="起止时间" prop="modifiedTime">
            <el-date-picker clearable size="small" style="width: 200px"
              v-model="formPr.modifiedTime"
              type="date"
              value-format="yyyy-MM-dd"
              placeholder="选择最后修改时间">
            </el-date-picker>
            </el-form-item>

            <el-form-item label="优惠卷到期时间" prop="preferentialTime">
              <el-date-picker clearable size="small" style="width: 200px"
                              v-model="formPr.preferentialTime"
                              type="date"
                              value-format="yyyy-MM-dd"
                              placeholder="选择优惠卷时间期间">
              </el-date-picker>
            </el-form-item>


            <el-form-item label="状态" prop="preferentialState">
              <!--<el-input v-model="formPr.preferentialState" placeholder="请输入0 启用 1 禁用" />-->
              <el-select  v-model="formPr.preferentialState">
                <el-option label="启用" value="0" />
                <el-option label="禁用" value="1" />
              </el-select>
            </el-form-item>

          </el-form>
          <div slot="footer" class="dialog-footer">
            <el-button type="primary" @click="submitFormPr">确 定</el-button>
            <el-button @click="cancelPr">取 消</el-button>
          </div>
        </el-dialog>


      </el-card>

    </div>




  </div>
</template>

<script>

  import { listInfosi, getInfosi, delInfosi, addInfosi, updateInfosi, typeStatus,findAllList,addAccount } from "@/api/shopping/goods";
  import { listCard, getCard, delCard, addCard, updateCard, exportCard } from "@/api/shopping/preferential";
  import { listTeam, getTeam, delTeam, addTeam, updateTeam, exportTeam,supplierIdById } from "@/api/shopping/distribution";

  export default {
    name: "Goods",
    data(){
      return{
        AddCommonOne:[],
        //显示搜索条件
        showSearch: true,
        // 遮罩层
        loading: true,
        // 参数表格数据
        infoList:[],
        // 优惠卷表格数据
        cardList: [],
        teamList: [],
        // 选中数组
        ids: [],
        // 非单个禁用
        single: true,
        // 非多个禁用
        multiple: true,
        // 弹出层标题
        title: "",
        titlePr: "",
        titlePT: "",
        titleFX: "",
        titleFXER: "",
        titlebzj: "",
        open: false,
        openPr: false,
        openPT: false,
        openbzj: false,
        openFX: false,
        openFXER: false,
        // 日期范围
        dateRange: [],
        teamListaaa: [],
        uuu:'display:none',
        // 总条数
        total: 0,
        formbzj:{
          supplierIdNum:'',
        },
        form:{ },
        formPT:{ },
        formFXER:{ },
        formFX:{
          supplierIdfx:0,
        },
        formPr:{
          numsupplierId:0,
          numTime: 0,
        },

        queryParamsFX: {
          pageNum: 1,
          pageSize: 10,
          supplierId: null,
          commissionId: null,
          distributionCode: null,
          appId: null,
          appSecent: null,
          distributionUrl: null,
          distributionState: null,
          modifiedTime: null
        },

        // 查询参数
        queryParams: {
          pageNum: 1,
          pageSize: 10,
          supplierCode: null,
          supplierName: null,
          supplierType: null,
          supplierTypeform: null,
          linkMan: null,
          phoneNumber: null,
          bankName: null,
          bankAccount: null,
          address: null,
          supplierStatus: null,
          modifiedTime: null,
          shopsName: null,
          customerId: null
        },
      }
    },

    methods:{

      // listTeam(){
      //   listTeam(this.queryParamsFX).then(res=>{
      //   this.teamList = res.rows;
      //   this.total = res.total;
      //   })
      //
      // },
      handleStateFX(row){
        this.formFX.supplierIdfx=row.supplierId;
        addTeam(this.formFX).then(res=>{

        })
        this.resetFX();
        this.openFX = true;
        this.titleFX = "分销";

        supplierIdById(row.supplierId).then(res=>{
          this.teamList = res;

        })
      },
      resetFX() {
        this.formFX = {
          distributionId: null,
          supplierId: null,
          commissionId: null,
          distributionCode: null,
          appId: null,
          appSecent: null,
          distributionUrl: null,
          distributionState: null,
          modifiedTime: null
        };
        this.resetForm("formFX");
      },


      handleDeletebaozheng(row){
        this.openbzj = true;
        this.titlebzj = "保证金"
        this.formbzj.supplierIdNum = row.supplierId;
        console.log("this.formbzj.supplierIdNum***********"+this.formbzj.supplierIdNum)
      },

      handlePreferent(row){
        this.resetPr();
        this.openPr = true;
        this.titlePr = "添加优惠卷";
        this.formPr.numsupplierId = row.supplierId;
      },

      handleUpdateFX(row){
        this.resetFX();
        const distributionId = row.distributionId || this.ids
        getTeam(distributionId).then(res=>{
          this.formFXER = res.data;
        this.openFXER = true;
        this.titleFXER = "修改分销";
        })

      },
      handleUpdatePr(row) {
        this.resetPr();
        const preferentialId = row.preferentialId || this.ids
        getCard(preferentialId).then(response => {
          this.formPr = response.data;
        this.openPr = true;
        this.titlePr = "修改优惠卷";
      });
      },

      submitFormFXER(){
        this.$refs["formFXER"].validate(valid => {
          if(valid) {
            updateTeam(this.formFXER).then(response => {
              if (response.code === 200) {
              this.msgSuccess("修改成功");
              this.openFXER = false;

              this.openFX=false;

            }
          });
          }
        })
      },
      cancelFXER(){

      },

      submitFormbzj(){
        // this.$refs["formbzj"].validate(valid=>{
        //   if (valid){
        addAccount(this.formbzj).then(response => {
          if (response.code === 200) {
            this.msgSuccess("新增成功");
            this.openbzj = false;
            this.getList();
          }
        });
          // }
        // })
      },

      /** 提交按钮 */
      submitFormPr() {
        this.$refs["formPr"].validate(valid => {
          if (valid) {
            if (this.formPr.preferentialId != null) {
              updateCard(this.formPr).then(response => {
                if (response.code === 200) {
                this.msgSuccess("修改成功");
                this.openPr = false;
                this.uuu ='display:none';
                this.getList();
              }
            });
            } else {
              this.formPr.numTime = this.formPr.preferentialPrice;
              console.log("******************" +this.formPr.numTime);
                addCard(this.formPr).then(response => {

                  if (response.code === 200) {
                  this.msgSuccess("新增成功");
                  this.openPr = false;
                this.uuu ='display:none';
                  this.getList();
                }
              });

              // }

            }
          }
        });
      },
      /** 删除按钮操作 */
      handleDeletePr(row) {
        const preferentialIds = row.preferentialId || this.ids;
        this.$confirm('是否确认删除优惠卷编号为"' + preferentialIds + '"的数据项?', "警告", {
          confirmButtonText: "确定",
          cancelButtonText: "取消",
          type: "warning"
        }).then(function() {
          return delCard(preferentialIds);
        }).then(() => {
          this.getList();
        this.msgSuccess("删除成功");
        this.uuu ='display:none';
      }).catch(function() {});
      },



      dbClick(row){
         var supplierId =row.supplierId;
        listCard(supplierId).then(res=>{
          this.cardList = res;
        this.uuu ='display:block';
      })
      },
      // 表单重置
      resetPr() {
        this.formPr = {
          preferentialId: null,
          supplierId: null,
          productId: null,
          preferentialName: null,
          preferentialPrice: null,
          preferentialPriceMost: null,
          preferentialTime: null,
          preferentialType: null,
          preferentialState: null,
          preferentialRemark: null,
          modifiedTime: null
        };
      },

      // 表单重置
      reset() {
        this.form = {
          supplierId: null,
          supplierCode: null,
          supplierName: null,
          supplierType: null,
          supplierTypeform: null,
          linkMan: null,
          phoneNumber: null,
          bankName: null,
          bankAccount: null,
          address: null,
          supplierStatus: 0,
          modifiedTime: null,
          shopsName: null
        }

      },

      getList(){
        this.loading = true,
          listInfosi(this.queryParams).then(res=>{
            this.infoList = res.rows;
        this.total = res.total;
        this.loading = false;
      })
      },

      handleSelectionChange(selection){
        this.ids = selection.map(item => item.supplierId)
        this.single = selection.length!==1
        this.multiple = !selection.length
      },

      handleAdd(){
        this.reset();
        this.open = true;
        this.title="添加店铺"
      },

      handleUpdate(row){
        this.reset();
        const  supplierId = row.supplierId || this.ids
        getInfosi(supplierId).then(res=>{
          this.form = res.data;
        this.open = true;
        this.title = "修改店铺信息"
      })
      },
      findAllList(){
        findAllList().then(res=>{
          this.AddCommonOne = res;
        })
      },

      handleStatePT(row){
        this.reset();
        const  supplierId = row.supplierId || this.ids
        getInfosi(supplierId).then(res=>{
          this.formPT = res.data;
        this.openPT = true;
        this.findAllList();
        this.titlePT = "平台优惠卷"
      })
      },

      submitFormPT(row){
        this.$refs["formPT"].validate(valid=>{
          if(valid){
            if(this.formPT.supplierId != null){
              updateInfosi(this.formPT).then(res=>{
                if (res.code === 200){
                this.msgSuccess("你一同意使用平台优惠卷。亲😙");
                this.openPT = false;
                this.getList();
              }
            });
            }
          }
        })
      },

      submitForm(){
        this.$refs["form"].validate(valid=>{
          if (valid){
            if(this.form.supplierId != null){
              updateInfosi(this.form).then(res=>{
                if (res.code === 200){
                this.msgSuccess("修改数据成功");
                this.open = false;
                this.getList();
              }
            });
            }else{
              addInfosi(this.form).then(res=>{
                if(res.code === 200){
                this.msgSuccess("新增数据成功");
                this.open = false;
                this.getList();
              }
            })
            }
          }
        })

      },

      handleDelete(row){
        const supplierId =  row.supplierId || this.ids;
        this.$confirm('是否删除店铺信息为"'+supplierId+'"的数据项',"警告",{
          confirmButtonText: "确定",
          cancelButtonText: "取消",
          type: "warning"
        }).then(function () {
          return delInfosi(supplierId);
        }).then(()=>{
          this.getList();
        this.msgSuccess("删除数据成功");
      }).catch(function () {});
      },

      cancelPT(){
        this.openPT=false;
        this.reset();
      },

      cancelbzj(){
        this.openbzj = false;
      },

      cancel(){
        this.open=false;
        this.reset();
      },
      cancelPr(){
        this.openPr=false;
        this.resetPr();
      },


      handleStatusChange(row) {
        let text = row.supplierStatus === "0" ? "启用" : "停用";
        this.$confirm(
          '确认要"' + text + '" 用户吗?',
          "警告",
          {
            confirmButtonText: "确定",
            cancelButtonText: "取消",
            type: "warning",
          }).then(function () {
          return typeStatus(row.supplierId, row.supplierStatus);
        }).then(() => {
          this.msgSuccess(text + "成功");
      }).catch(function () {
          row.supplierStatus = row.supplierStatus === "0" ? "1" : "0";
        });
      },





    },
    components:{

    },
    created(){
      this.getList();
      this.listTeam();
    }

  }
</script>

<style>
</style>
